package com.example.falvback.mapper;

import com.example.falvback.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 功能：用户信息的mapper层
 * 作者：chen
 * 日期：2023/10/2220:20
 */
@Mapper
public interface UserMapper {

    @Select("select * from user ")
    List<User> showUser();
    @Select("select * from user where username = #{username}")
    List<User> showUserFile(String username);
    @Update("update user set username=#{username},phone=#{phone},residence=#{residence},address=#{address},password=#{password},avatar=#{avatar} where id=#{id}")
    void updateUser(User user);

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);


}
